home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / JButton.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.7 KB  |  79 lines

  1. package javax.swing;
  2.  
  3. import java.io.IOException;
  4. import java.io.ObjectOutputStream;
  5. import javax.accessibility.Accessible;
  6. import javax.accessibility.AccessibleContext;
  7. import javax.swing.plaf.ButtonUI;
  8.  
  9. public class JButton extends AbstractButton implements Accessible {
  10.    private static final String uiClassID = "ButtonUI";
  11.    private boolean defaultCapable;
  12.  
  13.    public JButton() {
  14.       this((String)null, (Icon)null);
  15.    }
  16.  
  17.    public JButton(String var1) {
  18.       this(var1, (Icon)null);
  19.    }
  20.  
  21.    public JButton(String var1, Icon var2) {
  22.       this.defaultCapable = true;
  23.       ((AbstractButton)this).setModel(new DefaultButtonModel());
  24.       ((AbstractButton)this).init(var1, var2);
  25.    }
  26.  
  27.    public JButton(Icon var1) {
  28.       this((String)null, var1);
  29.    }
  30.  
  31.    public AccessibleContext getAccessibleContext() {
  32.       if (super.accessibleContext == null) {
  33.          super.accessibleContext = new AccessibleJButton(this);
  34.       }
  35.  
  36.       return super.accessibleContext;
  37.    }
  38.  
  39.    public String getUIClassID() {
  40.       return "ButtonUI";
  41.    }
  42.  
  43.    public boolean isDefaultButton() {
  44.       JRootPane var1 = SwingUtilities.getRootPane(this);
  45.       if (var1 != null) {
  46.          return var1.getDefaultButton() == this;
  47.       } else {
  48.          return false;
  49.       }
  50.    }
  51.  
  52.    public boolean isDefaultCapable() {
  53.       return this.defaultCapable;
  54.    }
  55.  
  56.    protected String paramString() {
  57.       String var1 = this.defaultCapable ? "true" : "false";
  58.       return super.paramString() + ",defaultCapable=" + var1;
  59.    }
  60.  
  61.    public void setDefaultCapable(boolean var1) {
  62.       boolean var2 = this.defaultCapable;
  63.       this.defaultCapable = var1;
  64.       ((JComponent)this).firePropertyChange("defaultCapable", var2, var1);
  65.    }
  66.  
  67.    public void updateUI() {
  68.       ((AbstractButton)this).setUI((ButtonUI)UIManager.getUI(this));
  69.    }
  70.  
  71.    private void writeObject(ObjectOutputStream var1) throws IOException {
  72.       var1.defaultWriteObject();
  73.       if (super.ui != null && this.getUIClassID().equals("ButtonUI")) {
  74.          super.ui.installUI(this);
  75.       }
  76.  
  77.    }
  78. }
  79.